import Jetson.GPIO as GPIO
import time

# 设置GPIO模式为BOARD模式
GPIO.setmode(GPIO.BOARD)

# 定义LED引脚
led_pins = [12, 15, 21, 23]

# 配置LED引脚为输出模式
for pin in led_pins:
    GPIO.setup(pin, GPIO.OUT)

try:
    print("开始测试")
    
    while True:
        # 依次点亮每个LED灯带的小LED
        for pin in led_pins:
            
            GPIO.output(pin, GPIO.HIGH)
            time.sleep(0.3)  # 控制每个小LED点亮的时间
            GPIO.output(pin, GPIO.LOW)
            time.sleep(0.3)  # 控制每个小LED灭的时间
        
except KeyboardInterrupt:
    pass

finally:
    # 清理GPIO设置
    GPIO.cleanup()
    print("测试结束")
